package syscore

import (
	"net/http"

	"github.com/EDDYCJY/go-gin-example/pkg/app"
	"github.com/EDDYCJY/go-gin-example/pkg/e"
	"github.com/EDDYCJY/go-gin-example/service/syscore_service"
	"github.com/gin-gonic/gin"
)

type HomeVerify struct {
}

func Home(c *gin.Context) {
	var (
		appG = app.Gin{C: c}
		form HomeVerify
	)
	_, errCode := app.BindAndValidMsg(c, &form)
	if errCode != nil {
		appG.ResponseMsg(errCode, nil)
		return
	}

	Service := syscore_service.Home{}
	data, err := Service.Home()
	if err != nil {
		appG.ResponseMsg(err, nil)
		return
	}
	//异步日志
	appG.Response(http.StatusOK, e.SUCCESS, data)

}
